package com.withouther.robot.rainingrobot.core.constants;

/**
 * @ClassName RoleEnum
 * @Auther: tzq
 * @Date: 2020/6/10 08:44
 * @Description:角色枚举类
 */
public enum RoleEnum {
    CLIENT("客户", 0),SERVICE("坐席",1);

    // 成员变量
    private String name;
    private int index;
    RoleEnum(String 客户, int i) {
        this.name = name;
        this.index = index;
    }

    /**
     * 获取角色名称
     * @param index
     * @return
     */
    public static String getName(int index) {
        for (RoleEnum c : RoleEnum.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
